package com.todod.base.module.base.dal.mysql.deviceaccessdatarecord;

import java.util.*;

import com.todod.base.framework.common.pojo.PageResult;
import com.todod.base.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.todod.base.framework.mybatis.core.mapper.BaseMapperX;
import com.todod.base.module.base.dal.dataobject.deviceaccessdatarecord.DeviceAccessDataRecordDO;
import org.apache.ibatis.annotations.Mapper;
import com.todod.base.module.base.controller.admin.deviceaccessdatarecord.vo.*;

/**
 * 仪器接入数据记录 Mapper
 *
 * @author 平台
 */
@Mapper
public interface DeviceAccessDataRecordMapper extends BaseMapperX<DeviceAccessDataRecordDO> {

    default PageResult<DeviceAccessDataRecordDO> selectPage(DeviceAccessDataRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceAccessDataRecordDO>()
                .eqIfPresent(DeviceAccessDataRecordDO::getWellCode, reqVO.getWellCode())
                .eqIfPresent(DeviceAccessDataRecordDO::getDeviceCode, reqVO.getDeviceCode())
                .eqIfPresent(DeviceAccessDataRecordDO::getDataParams, reqVO.getDataParams())
                .betweenIfPresent(DeviceAccessDataRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceAccessDataRecordDO::getId));
    }

}